package com.xujiang.mytool.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.xujiang.common_adapter.base.BaseRecyclerAdapter;
import com.xujiang.common_adapter.holder.BaseRecyclerViewHolder;
import com.xujiang.mytool.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author xujiang
 * @version 2017-07-24 16:33
 */
public class StyleTestAdapter extends BaseRecyclerAdapter<String,StyleTestAdapter.StyleTestHolder>{

    public StyleTestAdapter(Context context) {
        super(context);
    }

    @Override
    public StyleTestHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflate(R.layout.item_style_test, parent, false);
        return new StyleTestHolder(view);
    }

    @Override
    public void onBindViewHolderItem(StyleTestHolder holder, String item, int position) {
        holder.onHandle(item,position,null);
    }

    class StyleTestHolder extends BaseRecyclerViewHolder<String>{
        @BindView(R.id.text)
        TextView textView;

        public StyleTestHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }

        @Override
        public void onHandle(String item, int position) {
            textView.setText(item);
        }
    }
}
